<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>FileRemoveDir</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link href="../static/theme.css" rel="stylesheet" type="text/css" />
<script src="../static/content.js" type="text/javascript"></script>
</head>
<body>

<h1>FileRemoveDir</h1>

<p>Deletes a folder.</p>

<pre class="Syntax">FileRemoveDir, DirName [, Recurse?]</pre>
<h3>Parameters</h3>
<dl>

  <dt>DirName</dt>
  <dd><p>Name of the directory to delete, which is assumed to be in <a href="../Variables.htm#WorkingDir">%A_WorkingDir%</a> if an absolute path isn't specified.</p></dd>

  <dt>Recurse?</dt>
  <dd><p><strong>0</strong> (default): Do <strong>not</strong> remove files and sub-directories contained in <em>DirName</em>. In this case, if <em>DirName</em> is not empty, no action will be taken and ErrorLevel will be set to 1.</p>
    <p><strong>1</strong>: Remove all files and subdirectories (like the Windows command &quot;rmdir /S&quot;).</p>
    <p>This parameter can be an <a href="../Variables.htm#Expressions">expression</a>, even one that evalutes to true or false (since true and false are stored internally as 1 and 0).</p></dd>

</dl>
<h3>ErrorLevel</h3>
<p><span class="ver">[v1.1.04+]</span> This command is able to throw an exception on failure. For more information, see <a href="Catch.htm#RuntimeErrors">Runtime Errors</a>.</p>
<p><a href="../misc/ErrorLevel.htm">ErrorLevel</a> is set to 1 if there was a problem or 0 otherwise.</p>
<h3>Remarks</h3>
<p>None</p>
<h3>Related</h3>
<p><a href="FileCreateDir.htm">FileCreateDir</a>, <a href="FileDelete.htm">FileDelete</a></p>
<h3>Example</h3>
<pre class="NoIndent">FileRemoveDir, C:\Download Temp
FileRemoveDir, C:\Download Temp, 1</pre>

</body>
</html>
